//
//  CZMainTabBar.swift
//  微博08
//
//  Created by mac on 16/2/28.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

class CZMainTabBar: UITabBar {
    
    override func layoutSubviews() {
        super.layoutSubviews()
        let width = frame.width / 5
        
        composeButton.frame = CGRectMake(0, 0, width, frame.height)
        
        composeButton.center = CGPointMake(frame.width * 0.5, frame.height * 0.5)
    }
    
    
    

    lazy var composeButton: UIButton =
    {
        let button = UIButton()
        
        button.setBackgroundImage(UIImage(named: "tabbar_compose_button"), forState: UIControlState.Normal)
        button.setBackgroundImage(UIImage(named: "tabbar_compose_button_highlighted"), forState: UIControlState.Highlighted)
        
        button.setImage(UIImage(named: "tabbar_compose_icon_add"), forState: UIControlState.Normal)
        button.setImage(UIImage(named: "tabbar_compose_icon_add_highlighted"), forState: UIControlState.Selected)
    
        
        self.addSubview(button)
        button.sizeToFit()
        
        return button
    }()

}
